<!doctype html>



  


<html class="theme-next mist use-motion">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/vendors/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/vendors/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.0.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="Java web," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.0.1" />






<meta name="description" content="说明：JFinal配置使用。">
<meta name="keywords" content="Java web">
<meta property="og:type" content="article">
<meta property="og:title" content="JFinal">
<meta property="og:url" content="http://bebetter.site/2017/01/12/Software/Java Web/JFinal/index.html">
<meta property="og:site_name" content="gatewayzy">
<meta property="og:description" content="说明：JFinal配置使用。">
<meta property="og:updated_time" content="2017-01-12T05:58:56.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="JFinal">
<meta name="twitter:description" content="说明：JFinal配置使用。">



<script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Mist',
    sidebar: {"position":"right","display":"always"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: 0,
      author: '博主'
    }
  };
</script>




  <link rel="canonical" href="http://bebetter.site/2017/01/12/Software/Java Web/JFinal/"/>

  <title> JFinal | gatewayzy </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  










  
  
    
  

  <div class="container one-collumn sidebar-position-right page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">gatewayzy</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">blog of gatewayzy</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
    </ul>
  

  
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                JFinal
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">发表于</span>
            <time itemprop="dateCreated" datetime="2017-01-12T13:58:10+08:00" content="2017-01-12">
              2017-01-12
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/Softwares/" itemprop="url" rel="index">
                    <span itemprop="name">Softwares</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
          

          

          
          

          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <p><strong>说明：</strong>JFinal配置使用。<br><a id="more"></a></p>
<hr>
<p>参考文章：</p>
<h2 id="JFianl简介"><a href="#JFianl简介" class="headerlink" title="JFianl简介"></a>JFianl简介</h2><p>JFinal是基于Java语言的极速WEB+ORM框架,其核心设计目标是开发迅速、代码量少、学习简单、功能强大、轻量级、易扩展、Restful。</p>
<h2 id="配置"><a href="#配置" class="headerlink" title="配置"></a>配置</h2><h3 id="web-xml"><a href="#web-xml" class="headerlink" title="web.xml"></a>web.xml</h3><p>必须启用JFinalFilter进行项目路由。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div></pre></td><td class="code"><pre><div class="line">&lt;web-app&gt;</div><div class="line">&lt;!-- 静态文件基路径 --&gt;</div><div class="line">	&lt;context-param&gt;</div><div class="line">		&lt;param-name&gt;resources&lt;/param-name&gt;</div><div class="line">		&lt;param-value&gt;/templateJFinalBSApp&lt;/param-value&gt;</div><div class="line">	&lt;/context-param&gt;</div><div class="line">&lt;filter&gt;</div><div class="line">    &lt;filter-name&gt;jfinal&lt;/filter-name&gt;</div><div class="line">    &lt;filter-class&gt;com.jfinal.core.JFinalFilter&lt;/filter-class&gt;  //jfinal内部类</div><div class="line">    &lt;init-param&gt;</div><div class="line">      &lt;param-name&gt;configClass&lt;/param-name&gt;</div><div class="line">      &lt;param-value&gt;config.TemplateConfig&lt;/param-value&gt;  //自己的config类</div><div class="line">    &lt;/init-param&gt;</div><div class="line">  &lt;/filter&gt;</div><div class="line">  &lt;filter-mapping&gt;</div><div class="line">    &lt;filter-name&gt;jfinal&lt;/filter-name&gt;</div><div class="line">    &lt;url-pattern&gt;/*&lt;/url-pattern&gt;  //拦截的url</div><div class="line">  &lt;/filter-mapping&gt;</div><div class="line">&lt;/web-app&gt;</div></pre></td></tr></table></figure>
<h3 id="config"><a href="#config" class="headerlink" title="config"></a>config</h3><hr>
<p>config类中进行ORM映射、常量设置、路由设置、拦截器设置等。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div><div class="line">46</div><div class="line">47</div><div class="line">48</div><div class="line">49</div><div class="line">50</div><div class="line">51</div><div class="line">52</div><div class="line">53</div></pre></td><td class="code"><pre><div class="line">public class TemplateConfig extends JFinalConfig&#123;</div><div class="line"></div><div class="line">	@Override</div><div class="line">	/*常量值*/</div><div class="line">	public void configConstant(Constants me) &#123;</div><div class="line">		// TODO Auto-generated method stub</div><div class="line">		//这些都可以使用JFinal自动生成模板，再参考JFianl手册</div><div class="line">		me.setDevMode(true);//选择开发模式，输出每次请求报告</div><div class="line">		me.setEncoding(&quot;UTF-8&quot;);//项目编码</div><div class="line">		me.setViewType(ViewType.JSP);//选择默认视图类型为jsp</div><div class="line">	&#125;</div><div class="line"></div><div class="line">	/*访问路由*/</div><div class="line">	@Override</div><div class="line">	public void configRoute(Routes me) &#123;</div><div class="line">		// TODO Auto-generated method stub</div><div class="line">		me.add(&quot;/&quot;, IndexController.class);</div><div class="line">		me.add(&quot;/index&quot;, IndexController.class);</div><div class="line">		me.add(&quot;/classes&quot;,ClassesController.class);</div><div class="line">		me.add(&quot;/student&quot;, StudentController.class);</div><div class="line">	&#125;</div><div class="line"></div><div class="line">	@Override</div><div class="line">	/*插件*/</div><div class="line">	public void configPlugin(Plugins me) &#123;</div><div class="line">		// TODO Auto-generated method stub</div><div class="line">		/*读取配置文件，默认路径为 src/main/resources*/</div><div class="line">		loadPropertyFile(&quot;mysqlTempl.txt&quot;);</div><div class="line">		/*启用C3p0数据库连接池插件，也可以使用DruidPlugin插件*/</div><div class="line">		C3p0Plugin cp = new C3p0Plugin(getProperty(&quot;url&quot;), getProperty(&quot;user&quot;), getProperty(&quot;password&quot;));</div><div class="line">		me.add(cp);</div><div class="line">		/*启用ActiveRecord数据库访问插件*/</div><div class="line">		ActiveRecordPlugin arp = new ActiveRecordPlugin(cp);</div><div class="line">		me.add(arp);</div><div class="line">		/*配置数据库访问*/</div><div class="line">		arp.addMapping(&quot;student&quot;, &quot;stuID&quot;,Student.class);</div><div class="line">		arp.addMapping(&quot;classes&quot;,&quot;claID&quot;, Classes.class);</div><div class="line">	&#125;</div><div class="line"></div><div class="line">	@Override</div><div class="line">	public void configInterceptor(Interceptors me) &#123;</div><div class="line">		// TODO Auto-generated method stub</div><div class="line">		/*全局拦截器*/</div><div class="line">		</div><div class="line">	&#125;</div><div class="line"></div><div class="line">	@Override</div><div class="line">	public void configHandler(Handlers me) &#123;</div><div class="line">		// TODO Auto-generated method stub</div><div class="line">		me.add(new ContextPathHandler(&quot;basePath&quot;));</div><div class="line">	&#125;</div><div class="line"></div><div class="line">&#125;</div></pre></td></tr></table></figure>
<h3 id="Controller"><a href="#Controller" class="headerlink" title="Controller"></a>Controller</h3><hr>
<p>Controller主要进行业务控制。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div></pre></td><td class="code"><pre><div class="line">public class ClassesController extends Controller&#123;</div><div class="line">public void index()&#123;</div><div class="line">		this.render(&quot;/index.html&quot;);</div><div class="line">	&#125;</div><div class="line">	</div><div class="line">	public void login() &#123;</div><div class="line">		setAttr(&quot;notice&quot;, &quot;test&quot;);</div><div class="line">		renderText(&quot;IndexController.login()&quot;);</div><div class="line">	&#125;</div><div class="line">	</div><div class="line">public void test() &#123;  // 数据分页</div><div class="line">		Map&lt;String, List&gt; map =new LinkedHashMap&lt;String, List&gt;();</div><div class="line">		int pageNumber = 1;</div><div class="line">		int pageSize = 2;</div><div class="line">		int totalpage;</div><div class="line">		int totalRow;</div><div class="line">		if(getParaToInt(&quot;pageNumber&quot;) != null)&#123;</div><div class="line">			pageNumber = getParaToInt(&quot;pageNumber&quot;);</div><div class="line">		&#125;</div><div class="line">		Page&lt;Classes&gt; classes = Classes.dao.paginate(pageNumber, pageSize, &quot;select * &quot;, &quot;from classes where claPeople &gt;?&quot;,20);</div><div class="line">		totalpage = classes.getTotalPage();</div><div class="line">		totalRow = classes.getTotalRow();</div><div class="line">		Classes list = classes.getList().get(0);</div><div class="line">		map.put(&quot;list&quot;, classes.getList());</div><div class="line">		renderJson(map);  // 直接返回给前台的ajax请求</div><div class="line">	&#125;</div><div class="line">	</div><div class="line">	@ActionKey(&quot;/actionKey&quot;)</div><div class="line">	public void lo() &#123;</div><div class="line">		this.renderText(&quot;通过@ActionKey访问此方法&quot;);</div><div class="line">		forwardAction(&quot;/classes/query&quot;);</div><div class="line">		/*forwardAction只会后台处理，前台的URL不变</div><div class="line">		 * redirect前台后台都会变，即前台重新请求*/</div><div class="line">	&#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<h4 id="Db与Record"><a href="#Db与Record" class="headerlink" title="Db与Record"></a>Db与Record</h4><hr>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">Record newUser = new Record().set(&quot;user_name&quot;, userName)；</div><div class="line">Db.save(&quot;user_count_info&quot;, newUser);</div><div class="line">Long ii = newUser.get(&quot;id&quot;);//必须使用id这一字段，与表的主键名无关</div><div class="line">int ID = ii.intValue(); //获取插入的数据的主键，需要注意是否长度溢出</div></pre></td></tr></table></figure>
<h4 id="Model与dao"><a href="#Model与dao" class="headerlink" title="Model与dao"></a>Model与dao</h4><hr>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">User user = User.dao.findFirst(&quot;SELECT * FROM `user_count_info` WHERE id = ? &quot;, id);</div></pre></td></tr></table></figure>
<h3 id="Model"><a href="#Model" class="headerlink" title="Model"></a>Model</h3><hr>
<p>Model中常常设置全局静态实例化dao对象进行数据库ORM操作。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div></pre></td><td class="code"><pre><div class="line">public class Classes extends Model&lt;Classes&gt;&#123;</div><div class="line">	</div><div class="line">	/*获取更多方法，请查阅JFinal的Model类介绍*/</div><div class="line">	public static final Classes dao = new Classes();</div><div class="line">	/*dao对象是全局共享的，只能用于数据库查询（查改删），</div><div class="line">	 * 不能用于数据承载（增），数据承载需要使用new Classes().set(&quot;name&quot;,&quot;James&quot;).save()*/</div><div class="line"></div><div class="line">	/**</div><div class="line">	// 创建name属性为James,age属性为25的User对象并添加到数据库</div><div class="line">	new User().set(&quot;name&quot;, &quot;James&quot;).set(&quot;age&quot;, 25).save();</div><div class="line">	// 删除id值为25的User</div><div class="line">	User.dao.deleteById(25);</div><div class="line">	// 查询id值为25的User将其name属性改为James并更新到数据库</div><div class="line">	User.dao.findById(25).set(&quot;name&quot;, &quot;James&quot;).update();</div><div class="line">	// 查询id值为25的user, 且仅仅取name与age两个字段的值</div><div class="line">	User user = User.dao.findById(25, &quot;name, age&quot;);</div><div class="line">	// 获取user的name属性</div><div class="line">	String userName = user.getStr(&quot;name&quot;);</div><div class="line">	// 获取user的age属性</div><div class="line">	Integer userAge = user.getInt(&quot;age&quot;);</div><div class="line">	// 查询所有年龄大于18岁的user</div><div class="line">	List&lt;User&gt; users = User.dao.find(&quot;select * from user where age&gt;18&quot;);</div><div class="line">	// 分页查询年龄大于18的user,当前页号为1,每页10个user</div><div class="line">	Page&lt;User&gt; userPage = User.dao.paginate(1, 10, &quot;select * &quot;, &quot;from user where age &gt; ?&quot;, 18);</div><div class="line">	 * */</div><div class="line">	</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<h3 id="jsp"><a href="#jsp" class="headerlink" title="jsp"></a>jsp</h3><hr>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div><div class="line">46</div><div class="line">47</div><div class="line">48</div><div class="line">49</div><div class="line">50</div><div class="line">51</div><div class="line">52</div><div class="line">53</div><div class="line">54</div><div class="line">55</div><div class="line">56</div><div class="line">57</div><div class="line">58</div><div class="line">59</div><div class="line">60</div><div class="line">61</div><div class="line">62</div><div class="line">63</div><div class="line">64</div><div class="line">65</div><div class="line">66</div><div class="line">67</div><div class="line">68</div><div class="line">69</div><div class="line">70</div><div class="line">71</div></pre></td><td class="code"><pre><div class="line">&lt;%@ page language=&quot;java&quot; contentType=&quot;text/html; charset=UTF-8&quot; pageEncoding=&quot;UTF-8&quot;%&gt;</div><div class="line">&lt;%@ taglib prefix=&quot;c&quot;  uri=&quot;http://java.sun.com/jsp/jstl/core&quot; %&gt;</div><div class="line">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;</div><div class="line">&lt;html&gt;</div><div class="line">&lt;head&gt;</div><div class="line">&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;</div><div class="line">&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot; src=&quot;$&#123;initParam.resources&#125;/static/js/jquery.min.js&quot;&gt;&lt;/script&gt;</div><div class="line">&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot; src=&quot;$&#123;initParam.resources&#125;/static/js/jquery-2.1.1.min.js&quot;&gt;&lt;/script&gt;</div><div class="line">&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot; src=&quot;$&#123;initParam.resources&#125;/static/js/jquery.pagination.js&quot;&gt;&lt;/script&gt;</div><div class="line">&lt;script type=&quot;text/javascript&quot;&gt;</div><div class="line">$(document).ready(function () &#123; </div><div class="line">	var maxentries = 7;			//总数据条数</div><div class="line">	pageselectCallback(0);</div><div class="line">	$(&quot;#panel&quot;).pagination(maxentries, &#123;	//此方法一次性加载，分页切换无刷新与延迟</div><div class="line">	    num_edge_entries: 2,	//边缘页数</div><div class="line">	    num_display_entries: 4,	//主体页数</div><div class="line">	    callback: pageselectCallback,//回调函数</div><div class="line">	    items_per_page:1,		//每页显示1项</div><div class="line">	    prev_text:&quot;上一页&quot;,</div><div class="line">	    next_text:&quot;下一页&quot;,</div><div class="line">	    ellipse_text:&quot;..&quot;		//省略的页数用什么文字表示</div><div class="line">	    </div><div class="line">	&#125;);</div><div class="line"></div><div class="line">function pageselectCallback(page) &#123; </div><div class="line">    var result = &quot;&quot;; </div><div class="line">    $.ajax(&#123; </div><div class="line">        type: &quot;post&quot;, </div><div class="line">        dataType: &quot;json&quot;, </div><div class="line">        url: &quot;classes/test&quot;, //请求的url </div><div class="line">        data: &#123; &quot;pageNumber&quot;: parseInt(page + 1) &#125;, </div><div class="line">        success: function (data) &#123;</div><div class="line">        	//alert(data);</div><div class="line">        	var content = &quot;&quot;;</div><div class="line">        	$.each(data.list,function(i,ite)&#123;</div><div class="line">        		var tmp=&quot;&quot;;</div><div class="line">        		tmp +=&quot;&amp;nbsp;&quot;+ite.claID;</div><div class="line">        		tmp +=&quot;&amp;nbsp;&quot;+ite.claName;</div><div class="line">        		tmp +=&quot;&amp;nbsp;&quot;+ite.claCharger;</div><div class="line">        		tmp +=&quot;&amp;nbsp;&quot;+ite.claPeople;</div><div class="line">        		tmp +=&quot;&lt;br&gt;&quot;;</div><div class="line">        		result += tmp;</div><div class="line">        	&#125;)</div><div class="line">        	$(&quot;#result&quot;).html(result);</div><div class="line">        &#125;,</div><div class="line">        error:function(textStatus)&#123;</div><div class="line">        	alert(&quot;error!&quot;);</div><div class="line">        	console.info(msg);</div><div class="line">        &#125;</div><div class="line">  </div><div class="line">&#125;);</div><div class="line">&#125; </div><div class="line">&#125;); </div><div class="line">&lt;/script&gt;</div><div class="line">&lt;title&gt;test&lt;/title&gt;</div><div class="line">&lt;/head&gt;</div><div class="line">&lt;body&gt;</div><div class="line">	&lt;table border=&quot;1&quot;&gt;</div><div class="line">		&lt;tr&gt;</div><div class="line">			&lt;td&gt;claID&lt;/td&gt;</div><div class="line">			&lt;td&gt;班级名称&lt;/td&gt;</div><div class="line">			&lt;td&gt;负责人: $&#123;notice&#125;&lt;/td&gt;</div><div class="line">			&lt;td&gt;班级人数&lt;/td&gt;</div><div class="line">		&lt;/tr&gt;</div><div class="line">	&lt;/table&gt;</div><div class="line">	&lt;div id=&quot;result&quot;&gt;&lt;/div&gt;</div><div class="line">	&lt;div id=&quot;panel&quot;&gt;&lt;/div&gt;</div><div class="line"></div><div class="line">	&lt;%@ include file=&apos;./common.jsp&apos; %&gt;</div><div class="line">&lt;/body&gt;</div><div class="line">&lt;/html&gt;</div></pre></td></tr></table></figure>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Java-web/" rel="tag">#Java web</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/01/12/Software/Continuous integration and delivery 持续集成与交付 CI&CD/Jenkins/" rel="next" title="Jenkins">
                <i class="fa fa-chevron-left"></i> Jenkins
              </a>
            
          </div>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/01/12/Software/Java Web/JavaTools/" rel="prev" title="JavaTools">
                JavaTools <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    


  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel ">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/statics/images/avatar.png"
               alt="gatewayzy" />
          <p class="site-author-name" itemprop="name">gatewayzy</p>
          <p class="site-description motion-element" itemprop="description">blog website with hexo and github pages</p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">70</span>
              <span class="site-state-item-name">日志</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">10</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">38</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              友情链接
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="https://github.com/gatewayzy" title="Github-gatewayzy" target="_blank">Github-gatewayzy</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://google.com/" title="Goolge" target="_blank">Goolge</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://wiki.jikexueyuan.com/" title="Wiki-jike" target="_blank">Wiki-jike</a>
                </li>
              
            </ul>
          </div>
        

      </section>

      
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">
            
              
            
            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#JFianl简介"><span class="nav-number">1.</span> <span class="nav-text">JFianl简介</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#配置"><span class="nav-number">2.</span> <span class="nav-text">配置</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#web-xml"><span class="nav-number">2.1.</span> <span class="nav-text">web.xml</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#config"><span class="nav-number">2.2.</span> <span class="nav-text">config</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Controller"><span class="nav-number">2.3.</span> <span class="nav-text">Controller</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#Db与Record"><span class="nav-number">2.3.1.</span> <span class="nav-text">Db与Record</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Model与dao"><span class="nav-number">2.3.2.</span> <span class="nav-text">Model与dao</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Model"><span class="nav-number">2.4.</span> <span class="nav-text">Model</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#jsp"><span class="nav-number">2.5.</span> <span class="nav-text">jsp</span></a></li></ol></li></ol></div>
            
          </div>
        </section>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">gatewayzy</span>
</div>

<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Mist
  </a>
</div>

        

        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/vendors/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/vendors/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/vendors/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/vendors/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/vendors/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/vendors/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.0.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.0.1"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.0.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.0.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.0.1"></script>



  



  




  
  

  
  <script type="text/x-mathjax-config">
    MathJax.Hub.Config({
      tex2jax: {
        inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
        processEscapes: true,
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
      }
    });
  </script>

  <script type="text/x-mathjax-config">
    MathJax.Hub.Queue(function() {
      var all = MathJax.Hub.getAllJax(), i;
      for (i=0; i < all.length; i += 1) {
        all[i].SourceElement().parentNode.className += ' has-jax';
      }
    });
  </script>
  <script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>



  

  
<script type="text/javascript" async src="//push.zhanzhang.baidu.com/push.js">
</script>


</body>
</html>
